﻿<?php
include_once("../../includes/metodos.php");
include_once("action.php");

checkUser();
connectSql();
isAdmin();

if(!empty($_POST['cmd']) && $_POST['cmd']=='edit'){
	edit($_POST['id']);	
}
include_once ("../cabecalho.php");

$query = mysql_query("SELECT * FROM econ_glossario WHERE id=".anti_injection($_REQUEST['id']));
$row = mysql_fetch_array($query);
?>
<div id="conteudo_glossario">		
		<form action="edit.php" method="post">
    <br>
	<div id="div_sup_gloss_edit">
			<label id="label_gloss_edit">Titulo</label>
			<input type="text" name="titulo" value="<?php echo $row['tterm'];?>"/>
			<label id="label_gloss_edit">Link</label>
			<input type="text" name="link" value="<?php echo $row['link'];?>"/>
			<label id="label_gloss_edit">Letra</label>
			<input type="text" name="letra" value="<?php echo $row['letra']; ?>"/>
		<div id="div_gloss_edit_visu">
			<label id="label_gloss_edit">Vizualiza&ccedil;&atilde;o</label><br>
			<input type="radio" name="status" value="1" <?php if($row['status']==1){ echo 'checked="checked"'; }?>/><label id="label_gloss_edit_ativo">Ativo</label><br/>
			<input type="radio" name="status" value="2" <?php if($row['status']!=1){ echo 'checked="checked"'; }?>/><label id="label_col_new">Inativo</label><br/><br/>
		</div>
		<br><br><br><br>
	</div>		
		<div id="div_textarea_gloss_new">
		    <textarea name="conteudo"><?php echo $row['conteudo']; ?></textarea>
			<input type="hidden" name="cmd" value="edit">
			<br>
			<input type="hidden" name="id" value="<?php echo $_REQUEST['id'];?>">
			<input id="nova_noticia" type="submit" value="Editar"/>
		</div>
		</form>
</div> 